package main;

public class LeetCode16 {
    public static void main(String[] args) {
        int[] T = {73, 74, 75, 71, 69, 72, 76, 73};
        LeetCode16 leetCode16 = new LeetCode16();
        leetCode16.dailyTemperatures(T);
    }

    public int[] dailyTemperatures(int[] T) {
        int[] result = new int[T.length];
        for (int i = 0; i < T.length; i++) {
            int j = i;
            while (j < T.length) {
                if (T[j] > T[i]) {
                    result[i] = j - i;
                    break;
                }
                j++;
            }
        }
        return result;
    }
}